import { get , post } from '@/api/apiCode.js';
// 注册账号
export const reguser = async (user) => {
	const data = await post({ url: '/api/reguser' , data: user });
	return data;
};
// 用户登录
export const login = async (user) => {
	const data = await post({ url: '/api/login' , data: user });
	return data;
};
// 获取文章分类
export const articleCates = async () => {
	const data = await get({ url: '/my/article/cates' , value: "" });
	return data;
};
// 获取文章列表
export const articleList = async () => {
	const data = await get({ url: '/my/article/list' , value: "" });
	return data;
};
// 查询用户信息
export const userinfoLode = async () => {
	const data = await get({ url: '/my/userinfo' , value: "" });
	return data;
};
// 更改用户头像
export const updateAvatar = async (user) => {
	const data = await post({ url: '/my/update/avatar' , data: user });
	return data;
};
// 更改用户密码
export const updatePdatepwd = async (user) => {
	const data = await post({ url: '/my/updatepwd' , data: user });
	return data;
};
// 更改用户信息
export const updateUserinfo = async (user) => {
	const data = await post({ url: '/my/userinfo' , data: user });
	return data;
};
// 新增文章
export const articleAdd = async (item) => {
	const data = await post({ url: '/my/article/add' , data: item });
	return data;
};
// 新增文章分类
export const articleAddcates = async (item) => {
	const data = await post({ url: '/my/article/addcates' , data: item });
	return data;
};
// 更改文章信息
export const articleTextUpdate = async (item) => {
	const data = await post({ url: '/my/article/text/update' , data: item });
	return data;
};
// 删除文章数据
export const articleTextDelete = async (item) => {
	const data = await post({ url: '/my/article/text/delete' , data: item });
	return data;
};
// 更改文章分类
export const articleUpdatecate = async (item) => {
	const data = await post({ url: '/my/article/updatecate' , data: item });
	return data;
};
// 删除文章分类
export const articleDeletecate = async (id) => {
	const data = await get({ url: "/my/article/deletecate/", value: id });
	return data;
};
// 获取文章详情
export const articleTextQuery = async (item) => {
	const data = await post({ url: '/my/article/text/query' , data: item });
	return data;
};